/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package canteen.sys.view.individual;

import canteen.sys.model.entity.ItemTypeMaster;
import canteen.sys.view.ComboboxRecInfo;
import javax.swing.DefaultListModel;

/**
 *
 * @author TNT
 */
public class Menu extends javax.swing.JInternalFrame {

    /**
     * Creates new form Menu
     */
    public Menu() {
        initComponents();
        DefaultListModel listModel = new DefaultListModel();
        ComboboxRecInfo<ItemTypeMaster> list = new ComboboxRecInfo<>();
        ItemTypeMaster itm = new ItemTypeMaster();
        itm.setItemTypeName("CoCa");
        itm.setStatus(true);
        list.setName(itm.getItemTypeName());
        list.setKeyData(itm);
        listModel.addElement(list);
        listItemType.setModel(listModel);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        listItemType = new javax.swing.JList();
        jScrollPane2 = new javax.swing.JScrollPane();
        tbItem = new javax.swing.JTable();

        setClosable(true);
        setTitle("Menu");

        listItemType.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                listItemTypeMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(listItemType);

        tbItem.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(tbItem);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 152, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(0, 0, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jScrollPane1)
            .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 526, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void listItemTypeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listItemTypeMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_listItemTypeMouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JList listItemType;
    private javax.swing.JTable tbItem;
    // End of variables declaration//GEN-END:variables
}
